/*
   Copyright (C) 2011 Roman Belov <romblv@gmail.com>

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _H_EDSIM_
#define _H_EDSIM_

#include "lang/parser.h"
#include "util/list.h"

struct edsim_global {
	int			run_tick;	/* runtime tick number */
	list_node_t		def_list;	/* deferred work list */
	int			def_call;	/* is it deferred call or not */
};

extern struct edsim_global glob;

void
edsim_lib_share_in(struct module *m, int *arg, int n);

int
edsim_lib_share_out(struct module *m, int i, int val);

int
edsim_lib_share_unpull(struct module *m, int i);

void
edsim_lib_share_spec_fail_report(struct module *m, struct spec *s);

int
edsim_calc(struct module *m);

void
edsim_simulate(const char *file);

#endif /* _H_EDSIM_ */

